package com.cictec.middleware.tde.rm.disp.receiver.handler;

import org.apache.mina.core.session.IoSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.cictec.middleware.tde.rm.disp.annotation.HandleMessages;
import com.cictec.middleware.tde.rm.disp.receiver.AbstractReceiverHandler;
import com.cictec.middleware.tde.rm.protocol.TerminalMessage;

/**
 * 0x05 心跳连接指令,接收指令应答确认
 * 
 * @author Administrator
 *
 */
@Component
@HandleMessages(0X05)
public class TerminalHeatbeatHandler extends AbstractReceiverHandler {

	private static Logger logger = LoggerFactory.getLogger(TerminalHeatbeatHandler.class);

	@Override
	public void handleMessage(TerminalMessage msg, IoSession session) {
		// 0x80 指令应答 收到需要应答的数据包
		sendMessageToTerminal(createResponse(msg, 1), session);

		logger.debug("【0x05  心跳连接指令】收到心跳包  Session {}", msg.getSessionId());

	}

}
